package com.qf.exception;

import com.qf.vo.R;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 作者：WXH
 * 时间：2023/10/17
 * 描述：冲冲冲！！！
 */
@ControllerAdvice
@ResponseBody
public class ExceptionResolver {
    @ExceptionHandler(AccessDeniedException.class)
    public R ex(){
        return R.fail(R.Code.NoPermissions,"没有权限访问");
    }
}
